package org.shj.pattern.flyweight

class Qizi(val color: String){
  
  def put(x:Int, y: Int){
    println(s"put $color at ($x, $y)")
  }
}

object Factory {
  val map = Map[String, Qizi]()
  
  def getQizi(color: String) : Qizi = {
    map.getOrElse(color, new Qizi(color))
  }
}